--Generated Upgrade For Version 0.0.0.0.5
--Generated on 2010-03-23 16:44:09

if exists (select * from dbo.sysindexes where name = 'IDX_SIMPLE_TABLE_NAME')
DROP INDEX [IDX_SIMPLE_TABLE_NAME] ON [SIMPLE_TABLE]

select 'ALTER TABLE [SIMPLE_TABLE] DROP CONSTRAINT ' + [name] as 'sql' into #t from sysobjects where id IN( select sc.cdefault FROM dbo.sysobjects SO INNER JOIN dbo.syscolumns SC ON SO.id = SC.id LEFT JOIN dbo.syscomments SM ON SC.cdefault = SM.id WHERE SO.xtype = 'U' and SO.NAME = 'SIMPLE_TABLE' and SC.NAME = 'Name' )
declare @sql nvarchar (1000)
SELECT @sql = MAX([sql]) from #t
exec (@sql)
drop table #t
if exists (select * from syscolumns c inner join sysobjects o on c.id = o.id where c.name = 'Name' and o.name = 'SIMPLE_TABLE')
BEGIN
if exists (select * from dbo.sysindexes where name = 'IDX_SIMPLE_TABLE_NAME')
DROP INDEX [IDX_SIMPLE_TABLE_NAME] ON [SIMPLE_TABLE]

ALTER TABLE [SIMPLE_TABLE] ALTER COLUMN [Name] [VarChar] (50) NULL
END

GO

